package com.plian.system.service.hr.recruitment.impl;

import com.plian.Tools.*;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.constant.baseinfo.ValueSetConstant;
import com.plian.system.constant.sys.FormStatusConstant;
import com.plian.system.dto.hr.recruitment.RecruitmentManagementDTO;
import com.plian.system.entity.hr.recruitment.RecruitmentManagement;
import com.plian.system.mapper.hr.employment.EnterpriseEmploymentMapper;
import com.plian.system.mapper.hr.recruitment.RecruitmentManagementMapper;
import com.plian.system.mybatis.base.BaseServiceImpl;
import com.plian.system.service.bt.baseinfo.BaseInfoService;
import com.plian.system.service.hr.recruitment.IRecruitmentManagementChildService;
import com.plian.system.service.hr.recruitment.IRecruitmentManagementService;
import com.plian.system.service.sys.orgzation.OrgzationService;
import com.plian.system.service.wf.FormWorkflowService;
import com.plian.system.vo.hr.employment.EnterpriseRecruitmentVO;
import com.plian.system.vo.report.HeaderVO;
import com.plian.system.vo.report.ReportReturnVO;
import com.plian.system.vo.report.ReportVO;
import com.plian.system.wrapper.hr.recruitment.RecruitmentManagementWrapper;
import lombok.AllArgsConstructor;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.stream.Collectors;

/**
 * 招聘管理 服务实现类
 *
 * @author gangan
 * @since 2019-11-15
 */
@Service
@AllArgsConstructor
public class RecruitmentManagementServiceImpl extends BaseServiceImpl<RecruitmentManagementMapper, RecruitmentManagement> implements IRecruitmentManagementService
//		, BaseFlowService
{


	private IRecruitmentManagementChildService recruitmentManagementChildService;

	private EnterpriseEmploymentMapper enterpriseEmploymentMapper;

	private FormWorkflowService formWorkflowService;

	private BaseInfoService baseInfoService;

	private OrgzationService orgzationService;


	private RecruitmentManagementWrapper recruitmentManagementWrapper;


//	@Override TODO DEL
//	@Transactional(rollbackFor=RuntimeException.class)
//    public boolean saveOrUpdate(RecruitmentManagement recruitmentManagement) {
//        /*if (recruitmentManagement.getStatus() != null && recruitmentManagement.getStatus() != BillStatus.INIT.billStatus() ) {
//            return false;
//        }*/
//		if(recruitmentManagement.getStatus()==null){
//			recruitmentManagement.setStatus(FormStatusConstant.UNREVIEWED);
//		}
//        return super.saveOrUpdate(recruitmentManagement);
//    }
//
//    @Override
//    public boolean deleteLogic(List<Long> ids) {
//		for (Long id : ids) {
//			RecruitmentManagement recruitmentManagement = getById(id);
//			if (recruitmentManagement == null) {
//				return false;
//			} else if (recruitmentManagement.getStatus() != null &&
//					(recruitmentManagement.getStatus() != FormStatusConstant.STASH && recruitmentManagement.getStatus() != FormStatusConstant.UNREVIEWED)) {
//				return false;
//			}
//			formWorkflowService.deleteProcessInstance(String.valueOf(id));
//		}
//		boolean result = super.deleteLogic(ids);
//		if (result){
//			recruitmentManagementChildService.deleteLogicRecruitmentManagementId(ids);
//		}
//		return result;
//    }
//
//    @Override
//    public HashMap<String,Object> commit(String id) {
//        handleStatus(Long.valueOf(id), FormStatusConstant.FLOW);
//
//		//将需要提交的流程变量返回，用于工作流侧
//		return new HashMap<String,Object>();
//    }
//
//    @Override
//    public Boolean finish(String id) {
//        return handleStatus(Long.valueOf(id), FormStatusConstant.FINISH);
//    }
//
//
//    @Override
//    public Boolean reject(String id, int formState, String comment) {
//        return handleStatus(Long.valueOf(id), formState);
//    }
//
//    @Override
//    public R<RecruitmentManagementVO> getDetailObj(RecruitmentManagementVO recruitmentManagementVO){
//        if(!Optional.ofNullable(recruitmentManagementVO).isPresent()){
//            return new R(CommonCode.FAIL);
//        }
//        recruitmentManagementVO.setRecruitmentManagementChildVO(recruitmentManagementChildWrapper
//                .entityToVO(recruitmentManagementChildService.list(new LambdaQueryWrapper<RecruitmentManagementChild>()
//                        .eq(RecruitmentManagementChild::getRecruitmentManagementId, recruitmentManagementVO.getId()))));
//        return R.data(recruitmentManagementVO);
//    }
//
//	@Override
//	public RecruitmentManagementVO setChild(RecruitmentManagementVO recruitmentManagementVO){
//		if(!Optional.ofNullable(recruitmentManagementVO).isPresent()){
//			return null;
//		}
//		recruitmentManagementVO.setRecruitmentManagementChildVO(recruitmentManagementChildWrapper
//				.entityToVO(recruitmentManagementChildService.list(new LambdaQueryWrapper<RecruitmentManagementChild>()
//						.eq(RecruitmentManagementChild::getRecruitmentManagementId, recruitmentManagementVO.getId()))));
//		return recruitmentManagementVO;
//	}
//
//	@Override
//	public Boolean saveChild(RecruitmentManagementVO recruitmentManagementVO){
//		//学历学位
//		try {
//			List<RecruitmentManagementChildVO> recruitmentManagementChildVO = recruitmentManagementVO.getRecruitmentManagementChildVO();
//			for (RecruitmentManagementChildVO one : recruitmentManagementChildVO) {
//				if (one.getId() != null && Optional.ofNullable(one.getIsDeleted()).isPresent() && one.getIsDeleted().intValue() == 1) {
//					recruitmentManagementChildService.removeById(one.getId());
//				}else {
//					one.setRecruitmentManagementId(recruitmentManagementVO.getId());
//					recruitmentManagementChildService.saveOrUpdate(one);
//				}
//			}
//
//
//		}catch (Exception e){
//			log.error(ExceptionUtils.getFullStackTrace(e));
//			return false;
//		}
//		return true;
//	}
//
//	@Override
//	public java.io.File exportExcel(JSONObject jsonObject) {
//		List<SearchEntity> entityList = Optional.ofNullable(jsonObject.getJSONArray("query"))
//			.map(x -> x.toJavaList(SearchEntity.class)).orElse(new ArrayList<>());
//		QueryWrapper<RecruitmentManagement> qw= SearchParamEntiy.getQueryWrapper(
//			Condition.getQueryWrapper(new RecruitmentManagement()), entityList
//		);
//
//		List<RecruitmentManagement> floors = list(qw);
//		return null;
//		//return ExcelUtils.exportExcelByList(jsonObject, RecruitmentManagementWrapper.build().listVO(floors));
//	}
//
//	@Override
//	public ReportReturnVO report(RecruitmentManagementDTO recruitmentManagementDTO){
//		ReportReturnVO reportReturnVO = new ReportReturnVO();
//		ReportVO reportVO = new ReportVO();
//
//		reportVO.addHeader(HeaderVO.builder().key("companyName").title("招聘单位名称").build())
//			.addHeader(HeaderVO.builder().key("recruitmentAttributeName").title("招聘属性").build())
//			.addHeader(HeaderVO.builder().key("recruitmentMethodsName").title("招聘方式").build())
//			.addHeader(HeaderVO.builder().key("recruitmentNeedPeople").title("招聘需求人数").build())
//			.addHeader(HeaderVO.builder().key("resumeNumber").title("现场收到简历数").build())
//			.addHeader(HeaderVO.builder().key("intervieweesNumber").title("进入面试人数").build())
//			.addHeader(HeaderVO.builder().key("actualRecruitment").title("最终招录人数").build());
//
//		List<RecruitmentManagementVO> list = recruitmentManagementWrapper.entityToVO(baseMapper.reportDataPage(recruitmentManagementDTO.getCompanyNameIds(),recruitmentManagementDTO.getRecruitmentAttributeId(),
//						recruitmentManagementDTO.getRecruitmentMethodsId(), recruitmentManagementDTO.getRecruitmentTimeStart(),recruitmentManagementDTO.getRecruitmentTimeEnd()));
//
//		list = list.parallelStream().sorted(Comparator.comparing(RecruitmentManagementVO::getCompanyCode).thenComparing(RecruitmentManagementVO::getRecruitmentAttributeCode).thenComparing(RecruitmentManagementVO::getRecruitmentMethodsCode)).collect(Collectors.toList());
//
//		List<RecruitmentManagementVO> list2 = new ArrayList<>() ;
//		String companyNameSearchId = "";
//
//
//		//总计临时变量
//		RecruitmentManagementVO totalSum = new RecruitmentManagementVO();
//		totalSum.setRecruitmentNeedPeople(0);
//		totalSum.setResumeNumber(0);
//		totalSum.setIntervieweesNumber(0);
//		totalSum.setActualRecruitment(0);
//		//小计临时变量
//		RecruitmentManagementVO smallSum = new RecruitmentManagementVO();
//		smallSum.setRecruitmentNeedPeople(0);
//		smallSum.setResumeNumber(0);
//		smallSum.setIntervieweesNumber(0);
//		smallSum.setActualRecruitment(0);
//		int count = 0;
//		int sum = 0;
//		for(int i =0;i< list.size();i++){
//			if(companyNameSearchId.equals(list.get(i).getCompanyNameId())){
//				if(i>0){
//					RecruitmentManagementVO Total = new RecruitmentManagementVO();
//					Total.setCompanyName("记录数小计");
//					Total.setRecruitmentAttributeName(String.valueOf(count));
//					Total.setRecruitmentMethodsName("小计");
//					Total.setRecruitmentNeedPeople(smallSum.getRecruitmentNeedPeople());
//					Total.setResumeNumber(smallSum.getResumeNumber());
//					Total.setIntervieweesNumber(smallSum.getIntervieweesNumber());
//					Total.setActualRecruitment(smallSum.getActualRecruitment());
//					list2.add(Total);
//
//					sum+=count;
//					totalSum.setRecruitmentNeedPeople(totalSum.getRecruitmentNeedPeople()+smallSum.getRecruitmentNeedPeople());
//					totalSum.setResumeNumber(totalSum.getResumeNumber()+smallSum.getResumeNumber());
//					totalSum.setIntervieweesNumber(totalSum.getIntervieweesNumber()+smallSum.getIntervieweesNumber());
//					totalSum.setActualRecruitment(totalSum.getActualRecruitment()+smallSum.getActualRecruitment());
//
//				}
//				companyNameSearchId = list.get(i).getCompanyNameId();
//				count = 1;
//				smallSum.setRecruitmentNeedPeople(list.get(i).getRecruitmentNeedPeople());
//				smallSum.setResumeNumber(list.get(i).getResumeNumber());
//				smallSum.setIntervieweesNumber(list.get(i).getIntervieweesNumber());
//				smallSum.setActualRecruitment(list.get(i).getActualRecruitment());
//
//			}else{
//				count++;
//				smallSum.setRecruitmentNeedPeople(smallSum.getRecruitmentNeedPeople()+list.get(i).getRecruitmentNeedPeople());
//				smallSum.setResumeNumber(smallSum.getResumeNumber()+list.get(i).getResumeNumber());
//				smallSum.setIntervieweesNumber(smallSum.getIntervieweesNumber()+list.get(i).getIntervieweesNumber());
//				smallSum.setActualRecruitment(smallSum.getActualRecruitment()+list.get(i).getActualRecruitment());
//			}
//			list2.add(list.get(i));
//		}
//		sum+=count;
//		totalSum.setRecruitmentNeedPeople(totalSum.getRecruitmentNeedPeople()+smallSum.getRecruitmentNeedPeople());
//		totalSum.setResumeNumber(totalSum.getResumeNumber()+smallSum.getResumeNumber());
//		totalSum.setIntervieweesNumber(totalSum.getIntervieweesNumber()+smallSum.getIntervieweesNumber());
//		totalSum.setActualRecruitment(totalSum.getActualRecruitment()+smallSum.getActualRecruitment());
//
//		RecruitmentManagementVO LastTotal = new RecruitmentManagementVO();
//		LastTotal.setCompanyName("记录数小计");
//		LastTotal.setRecruitmentAttributeName(String.valueOf(count));
//		LastTotal.setRecruitmentMethodsName("小计");
//		LastTotal.setRecruitmentNeedPeople(smallSum.getRecruitmentNeedPeople());
//		LastTotal.setResumeNumber(smallSum.getResumeNumber());
//		LastTotal.setIntervieweesNumber(smallSum.getIntervieweesNumber());
//		LastTotal.setActualRecruitment(smallSum.getActualRecruitment());
//		list2.add(LastTotal);
//
//		RecruitmentManagementVO LastSumTotal = new RecruitmentManagementVO();
//		LastSumTotal.setCompanyName("记录数总计");
//		LastSumTotal.setRecruitmentAttributeName(String.valueOf(sum));
//		LastSumTotal.setRecruitmentMethodsName("总计");
//		LastSumTotal.setRecruitmentNeedPeople(totalSum.getRecruitmentNeedPeople());
//		LastSumTotal.setResumeNumber(totalSum.getResumeNumber());
//		LastSumTotal.setIntervieweesNumber(totalSum.getIntervieweesNumber());
//		LastSumTotal.setActualRecruitment(totalSum.getActualRecruitment());
//		list2.add(LastSumTotal);
//
//
//		reportVO.setData(list2);
//		reportReturnVO.setGrids(reportVO);
//		return reportReturnVO;
//	}


	@Override
	public ReportReturnVO attributeReport(RecruitmentManagementDTO recruitmentManagementDTO){
		ReportReturnVO reportReturnVO = new ReportReturnVO();
		ReportVO reportVO = new ReportVO();
		reportVO.addHeader(HeaderVO.builder().key("companyName").title("招聘单位名称").build())
			.addHeader(HeaderVO.builder().key("attributeName").title("属性").build())
			.addHeader(HeaderVO.builder().key("numberOfPeople").title("招聘需求人数").build())
			.addHeader(HeaderVO.builder().key("actualRecruitment").title("最终招录人数").build())
			.addHeader(HeaderVO.builder().key("difference").title("差异").build());

		//获取计划属性和招聘方法的所有基础数据
		Map<String, String> planAttributeMap = baseInfoService.getChildMap(ValueSetConstant.PLAN_ATTRIBUTE);
		Map<String, String> recruitmentMethodsMap = baseInfoService.getChildMap(ValueSetConstant.RECRUITMENT_METHODS);

		//获取实际用工数据/招聘数据
		List<EnterpriseRecruitmentVO> enterpriseList = enterpriseEmploymentMapper.attributeReportPage(recruitmentManagementDTO.getCompanyNameIds(),
				recruitmentManagementDTO.getPlanAttributeIds(), recruitmentManagementDTO.getEnterpriseTimeStart(), recruitmentManagementDTO.getEnterpriseTimeEnd());
		List<EnterpriseRecruitmentVO> recruitmentList = baseMapper.attributeReportPage(recruitmentManagementDTO.getCompanyNameIds(),
				recruitmentManagementDTO.getRecruitmentMethodsIds(), recruitmentManagementDTO.getRecruitmentTimeStart(), recruitmentManagementDTO.getRecruitmentTimeEnd());

		//最终的结果集合
		List<EnterpriseRecruitmentVO> reportData = new ArrayList<>();

		//每家单位用工信息补足缺失的基础数据记录，并添加对应小计
		HashMap<String, String> planAttributeMapCopy = new HashMap<>();
		String id = "";
		int totalSum = 0;	//用工需招合计
		int smallSum = 0;
		planAttributeMapCopy.putAll(planAttributeMap);
		for(EnterpriseRecruitmentVO one:enterpriseList){
			if(StringUtil.isBlank(id)){
				id = one.getCompanyNameId();
			}
			if(!id.equals(one.getCompanyNameId())) {
				//补充缺失的基础数据
				for(String key:planAttributeMapCopy.keySet()){
					EnterpriseRecruitmentVO supply = new EnterpriseRecruitmentVO(id,key,1,0,null);
					reportData.add(supply);
				}
				//添加小计行
				EnterpriseRecruitmentVO count = new EnterpriseRecruitmentVO(id,null,1,smallSum,null);
				count.setAttributeName("小计");
				reportData.add(count);

				//还原/转变临时内容
				totalSum += smallSum;
				smallSum = 0;
				planAttributeMapCopy.clear();
				planAttributeMapCopy.putAll(planAttributeMap);
			}
			planAttributeMapCopy.remove(one.getAttributeId());
			smallSum += one.getNumberOfPeople();
			id = one.getCompanyNameId();
			reportData.add(one);
		}
		//若为非空列表，则增加补足最后的数据及小计
		if(StringUtil.isNotBlank(id)) {
			for(String key:planAttributeMapCopy.keySet()){
				EnterpriseRecruitmentVO supply = new EnterpriseRecruitmentVO(id,key,1,0,null);
				reportData.add(supply);
			}
			//添加小计行
			EnterpriseRecruitmentVO count = new EnterpriseRecruitmentVO(id,null,1,smallSum,null);
			count.setAttributeName("小计");
			reportData.add(count);

			//还原/转变临时内容
			totalSum += smallSum;
			smallSum = 0;
			planAttributeMapCopy.clear();
			planAttributeMapCopy.putAll(planAttributeMap);
		}

		//每家单位招聘信息补足缺失的基础数据记录，并添加对应小计
		HashMap<String, String> methodsMapCopy = new HashMap<>();
		id = "";
		int totalSum2 = 0;	//实际招聘合计
		int smallSum2 = 0;
		methodsMapCopy.putAll(recruitmentMethodsMap);
		for(EnterpriseRecruitmentVO one:recruitmentList){
			if(StringUtil.isBlank(id)){
				id = one.getCompanyNameId();
			}
			if(!id.equals(one.getCompanyNameId())) {
				//补充单位缺失的基础数据
				for(String key:methodsMapCopy.keySet()){
					EnterpriseRecruitmentVO supply = new EnterpriseRecruitmentVO(id,key,2,null,0);
					reportData.add(supply);
				}
				//添加小计行
				EnterpriseRecruitmentVO count = new EnterpriseRecruitmentVO(id,null,2,null,smallSum2);
				count.setAttributeName("小计");
				reportData.add(count);

				//还原/转变临时内容
				totalSum2 += smallSum2;
				smallSum2 = 0;
				methodsMapCopy.clear();
				methodsMapCopy.putAll(recruitmentMethodsMap);
			}
			methodsMapCopy.remove(one.getAttributeId());
			smallSum2 += one.getActualRecruitment();
			id = one.getCompanyNameId();
			reportData.add(one);
		}
		//若为非空列表，则增加补足最后的数据及小计
		if(StringUtil.isNotBlank(id)) {
			for(String key:methodsMapCopy.keySet()){
				EnterpriseRecruitmentVO supply = new EnterpriseRecruitmentVO(id,key,2,null,0);
				reportData.add(supply);
			}
			//添加小计行
			EnterpriseRecruitmentVO count = new EnterpriseRecruitmentVO(id,null,2,null,smallSum2);
			count.setAttributeName("小计");
			reportData.add(count);

			//还原/转变临时内容
			totalSum2 += smallSum2;
			smallSum2 = 0;
			methodsMapCopy.clear();
			methodsMapCopy.putAll(recruitmentMethodsMap);
		}

		//获取用工 / 招聘的单位集合
		List<String> enterpriseDept = enterpriseList.parallelStream().map(EnterpriseRecruitmentVO::getCompanyNameId).distinct().collect(Collectors.toList());
		List<String> recruitmentDept = recruitmentList.stream().map(EnterpriseRecruitmentVO::getCompanyNameId).distinct().collect(Collectors.toList());
		List<String> enterpriseDeptCopy = new ArrayList<>(enterpriseDept);
		//获取招聘缺失的单位
		enterpriseDept.removeAll(recruitmentDept);
		//获取用工缺失的单位
		recruitmentDept.removeAll(enterpriseDeptCopy);

		List<EnterpriseRecruitmentVO> enterpriseMissList = new ArrayList<>();
		List<EnterpriseRecruitmentVO> recruitmentMissList = new ArrayList<>();
		recruitmentDept.forEach(x->{
			planAttributeMap.forEach((k,v) ->
				enterpriseMissList.add(new EnterpriseRecruitmentVO(x, k,1,0,null))
			);
			EnterpriseRecruitmentVO temp = new EnterpriseRecruitmentVO(x,null,1,0,null);
			temp.setAttributeName("小计");
			enterpriseMissList.add(temp);
		});

		enterpriseDept.forEach(x->{
			recruitmentMethodsMap.forEach((k,v) ->
					recruitmentMissList.add(new EnterpriseRecruitmentVO(x, k,2,null,0))
					);
			EnterpriseRecruitmentVO temp = new EnterpriseRecruitmentVO(x,null,2,null,0);
			temp.setAttributeName("小计");
			recruitmentMissList.add(temp);
		});

		reportData.addAll(enterpriseMissList);
		reportData.addAll(recruitmentMissList);

		if (CollectionUtil.isNotEmpty(reportData)){
			reportData.forEach(detail->{

				if(StringUtil.isNotBlank(detail.getCompanyNameId())){
					PageData org=orgzationService.getCompanyNameById(detail.getCompanyNameId());
					if(org!=null){
						detail.setCompanyName(org.getString("name"));
						detail.setCompanyCode(org.getString("orgCode"));
					}
				}
				if(detail.getRankNum()==1) {
					if(StringUtils.isEmpty(detail.getAttributeName())) {
						detail.setAttributeName(planAttributeMap.get(detail.getAttributeId()));
						detail.setAttributeCode(detail.getAttributeId());
					}
				}else{
					if(StringUtils.isEmpty(detail.getAttributeName())) {
						detail.setAttributeName(recruitmentMethodsMap.get(detail.getAttributeId()));
						detail.setAttributeCode(detail.getAttributeId());
					}

				}
			});
			reportData = reportData.parallelStream().sorted(Comparator.comparing(EnterpriseRecruitmentVO::getCompanyCode, (v1,v2)-> {
						if (StringUtils.isEmpty(v1) && StringUtils.isEmpty(v2)) {
							return 0;
						} else if (StringUtils.isNotEmpty(v1) && StringUtils.isNotEmpty(v2)) {
							return v1.compareTo(v2);
						} else if (StringUtils.isNotEmpty(v1)) {
							return -1;
						} else {
							return 1;
						}
					}).thenComparing(EnterpriseRecruitmentVO::getRankNum)
					.thenComparing(EnterpriseRecruitmentVO::getAttributeCode,(s1,s2)->{
						if(StringUtils.isEmpty(s1)&&StringUtils.isEmpty(s2)){
							return 0;
						}else if(StringUtils.isNotEmpty(s1)&&StringUtils.isNotEmpty(s2)){
							return s1.compareTo(s2);
						}else if(StringUtils.isNotEmpty(s1)){
							return -1;
						}else{
							return 1;
						}
					})).collect(Collectors.toList());
		}


		EnterpriseRecruitmentVO sum = new EnterpriseRecruitmentVO(null,null,null,totalSum,totalSum2);
		sum.setCompanyName("总计");
		sum.setDifference(totalSum-totalSum2);
		reportData.add(sum);

		reportVO.setData(reportData);
		reportReturnVO.setGrids(reportVO);
		return reportReturnVO;
	}

    /**
     * 统一处理状态机事件方法
     * @param id 主键
     * @param updateStatus 更新状态
     * @return boolean
     */
    private Boolean handleStatus(Long id, int updateStatus) {
        try {
            RecruitmentManagement recruitmentManagement = getById(id);
			/**
			 * 设置审批人和审批时间
			 */
			if (updateStatus == FormStatusConstant.FINISH){
				recruitmentManagement.setApprovedUser(TokenUtil.getTokenUserId());
				Date now = DateUtil.now();
				recruitmentManagement.setApprovedTime(now);
			}
            recruitmentManagement.setStatus(updateStatus);
            updateById(recruitmentManagement);
            return true;
        } catch (Exception e) {
            log.error(ExceptionUtils.getFullStackTrace(e));
            return false;
        }
    }

//	@Override
//	public List<PageData> findByIds(List<String> formIds) {
//		LambdaQueryWrapper<RecruitmentManagement> queryWrapper = new LambdaQueryWrapper<>();
//		queryWrapper.in(RecruitmentManagement::getId, Func.toLongList(StringUtils.join(formIds, StringPool.COMMA)));
//		List<RecruitmentManagement> recruitmentManagements = list(queryWrapper);
//		List<RecruitmentManagementVO> recruitmentManagementVOS = recruitmentManagementWrapper.entityToVO(recruitmentManagements);
//		List<PageData> pageDataList = new ArrayList<>();
//		try{
//			if (CollectionUtil.isNotEmpty(recruitmentManagementVOS)){
//				for (RecruitmentManagementVO vo : recruitmentManagementVOS){
//					PageData pd = new PageData();
//					pd.put("id", vo.getId());
//					pd.put("UNITNAME", vo.getCompanyName());
//					pd.put("APPLICANTNAME", vo.getCreateUserName());
//					pd.put("applicantId", vo.getCreateUser());
//					pd.put("applyOrganizationId", vo.getCompanyNameId());
//					pd.put("formType", FormTypeConstant.HR_RECRUITMENT_FORM);
//					pd.put("orgName", vo.getCompanyName());
//					pageDataList.add(pd);
//				}
//			}
//
//			return pageDataList;
//		} catch (Exception e) {
//			log.error(ExceptionUtils.getFullStackTrace(e));
//		}
//		return pageDataList;
//	}

//    @Override
//    public List<Integer> getFormType() {
//        return Arrays.asList(FormTypeConstant.HR_RECRUITMENT_FORM);
//    }
//
//    @Override
//    public void goBackToStash(String formId) {
//        handleStatus(Long.valueOf(formId), UNREVIEWED);
//    }
}
